<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Tymon\JWTAuth\Contracts\JWTSubject;

class User extends Authenticatable implements JWTSubject
{
    use HasFactory, Notifiable;

    protected $table = 'user';
    public $timestamps = false;

    protected $fillable = [
        'id',
        'username',
        'password',
        'nickName',
        'email',
        'phone',
        'roles',
        'createTime',
    ];

    /**
     * 获取JWT标识符
     */
    public function getJWTIdentifier()
    {
        return $this->getKey();
    }

    /**
     * 获取JWT自定义声明
     */
    public function getJWTCustomClaims()
    {
        return [];
    }
}
